package com.glory.wxelectricitypda.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.wxelectricitypda.R;
import com.glory.wxelectricitypda.bean.BoxLabelReviewBean;

import java.util.List;

public class FinishedProductInspectionAdapter extends BaseQuickAdapter<BoxLabelReviewBean.XPACKAGEDETAILDTO, BaseViewHolder> {


    public FinishedProductInspectionAdapter(@Nullable List<BoxLabelReviewBean.XPACKAGEDETAILDTO> data) {
        super(R.layout.adapter_finished_product_inspection,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BoxLabelReviewBean.XPACKAGEDETAILDTO item) {

        helper.setText(R.id.boxNum,String.valueOf(helper.getAdapterPosition()+1));
        helper.setText(R.id.packLotid,item.getPACKLOTID());
        helper.setText(R.id.tempsourcemainQTY,String.valueOf(item.getPACKMAINQTY()));
        helper.setText(R.id.approvedQcResult,item.getAPPROVEDQCRESULT());
        if (item.getAPPROVEDQCRESULT().equals("OK")){
            helper.getView(R.id.llMain).setBackgroundColor(Color.parseColor("#89d961"));
        }

    }
}
